<template>
  <div class="navContent">
    <el-row>
      <el-col :span="24">
        <div class="nav">
          <div class="title" @click="goIndex()">Blog Of Us</div>
          <div class="container">
            <div style="line-height:48px;">
              <span class="board" @click="goBoard()">留言板</span>
              <!-- <span class="board" @click="goMineFollow()">我的关注</span> -->
              <el-input
                size="medium"
                placeholder="请输入搜索内容"
                prefix-icon="el-icon-search"
                v-model="searchContent"
                style="width:200px;margin-left:10px;"
                @keyup.enter.native="search()"
                >
              </el-input>
            </div>
          </div>
          <div class="user">
            <el-dropdown>
              <div class="user-img">
                <img src="" alt="当前用户">
              </div>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item @click.native="goLogin()">退出登录</el-dropdown-item>
                <el-dropdown-item @click.native="goSet()">修改个人信息</el-dropdown-item>
                <el-dropdown-item @click.native="goMineBlog()">我的博客</el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
            <el-button type="primary" class="btn" icon="el-icon-edit" @click="goWrite()">写文章</el-button>
          </div>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  name: 'navContent',
  props: {
    
  },
  data () {
    return {
      searchContent: ''//搜索内容值
    }
  },
  methods: {
    // 首页
    goIndex () {
      // this.$emit('goIndex','')
      this.$router.push('index')
    },
    // 退出登录
    goLogin () {
      this.$router.push('login')
    },
    // 去设置页
    goSet () {
      this.$router.push('setUp')
    },
    // 写文章
    goWrite () {
      this.$router.push('write')
    },
    // 留言板
    goBoard () {
      this.$router.push('board')
    },
    // 我的关注
    goMineFollow () {
      this.$router.push('mineFollow')
    },
    // 我的博客
    goMineBlog () {
      this.$router.push('mineBlog')
    },
    // 搜索
    search () {
      console.log(this.searchContent)
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

</style>
<style lang="less" scoped>
.nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 48px;
  padding: 5px 10px;
  border: 1px solid #eee;
  background-color: #fff;
  .title {
    line-height: 48px;
    font-size: 35px;
    font-weight: bold;
    background-image:-webkit-linear-gradient(bottom,#bdc3c7,#2c3e50); 
    -webkit-background-clip:text; 
    -webkit-text-fill-color:transparent; 
    cursor:pointer;
  }
  .board {
    margin-right: 20px;
    cursor: pointer;
  }
  .board:hover {
    color: #ea6f5a;
  }
  .container {
    width: 60%;
    height: 100%;
    margin: 0 auto;
  }
  .user {
    display: flex;
    align-items: center;
  }

  .user a {
    text-decoration: none;
    color: #ea6f5a;
  }
  .user-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid #ea6f5a;
    cursor: pointer;
    img {
      width: 100%;
      height: 100%;
    }
  }
  .spot {
    vertical-align: middle;
    font-size: 30px;
    color: #ccc;
  }
  .btn {
    height: 40px;
    padding: 10px;
    margin-left: 10px;
  }
  /deep/.el-input .el-input__inner{
    border-radius: 20px!important;
  }
}
</style>

